<?php
//DB Created by Rich L. a member in service in Northern Delaware.  Please feel free to share this code wherever it may be useful to alcholoics.  Should you have questons please contact me at sobernerd@gmail.com
$pageTitle = 'NDIAA - Administration - Intergoup Reps';
require_once ('../../config/include_paths.php');
require_once ('../../admin/config.php');
require_once('../../admin/dbconnect.php');	// database connect script.
session_start(); 

//Sedurity Check, is a valid user logged in? AND if not then display error message
if ($_SESSION['logged_in'] == 0) {
require ('../../admin/security_check.php');
// If everything is OK now process the page
} else {
processTable('groups');
					 
/* GROUPS group query main query for page*/
				$group_sql = "SELECT * FROM groups WHERE ir_fname <> '' ORDER BY ir_lname ASC";
				$group_result = mysql_query($group_sql) or die(mysql_error());
				$num_rows = mysql_num_rows($group_result);	
require_once ('../../admin/head.php');			
?>
<body>
<div id="wrapper">
  <div class="padb_cont">
    <div class="header"><?php echo $banner; ?></div>
  </div>
  <div class="navbox_cont">
    <div class="navbox_left">
      <div align="center">
        <?php require_once ('../../admin/admin_nav.php'); ?>
      </div>
    </div>
    <div class="main_content">
      <div align="left">
        <table class="tabletext">
          <tr height="26">
            <th> <div align="left"> <font face="Arial, Helvetica, sans-serif">Name</font></div></th>
            <th> <div align="left"> <font face="Arial, Helvetica, sans-serif">Group</font></div></th>
            <th> <div align="left"> <font face="Arial, Helvetica, sans-serif"> E-Mail</font></div></th>
            <th> <div align="right"> <font color="aqua"><?php echo $num_rows ?></font></div></th>
          </tr>
          <?php		
$i = 0;
// Get each row of data on each iteration until
// there is no more rows
// this code can be used or "while ($row = $result->fetchRow(DB_FETCHMODE_ASSOC))" can be used
	 while ($group_row = mysql_fetch_assoc($group_result))
	{   
		if ($i%2 == 0) 
		{
		$rowcolor="$reprowcolor";
		} else 
		{
		$rowcolor="white";
		}
		?>
          <tr onClick="DoNav('groupform.php?id=<?php echo $group_row[id]?>&amp;return_to=intergroup_reps.php');" onMouseOver="this.bgColor='#c2e7fb';" onMouseOut="this.bgColor='<?php echo $rowcolor?>';" bgcolor="<?php echo $rowcolor?>">
            <td><?php echo "$group_row[ir_lname], $group_row[ir_fname]" ?>/td>
            <td><?php echo "$group_row[groupname]";?></td>
            <td><?php echo "<a href=\"mailto:$group_row[ir_email]\">$group_row[ir_email]</a>&nbsp&nbsp"?></td>
            <td id="delete"><div align="right"> <a title="Delete" href="deleteform.php?id=<?php echo $row[id]?>&table=groups">Delete</a></div></td>
          </tr>
          <?php
	$i++;						
	}
echo "</table>";
}
mysql_close($conn);?>
        </table>
      </div>
    </div>
  </div>
</div>
</body>
</html>
